/* 通用移动端样式 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  nav {
    flex-wrap: wrap;
    margin-top: 10px;
  }
  
  nav a {
    margin: 5px 10px 5px 0;
  }
  
  .wallet-info {
    margin-top: 10px;
  }
  
  /* 交易界面优化 */
  .swap-container {
    flex-direction: column;
  }
  
  .swap-input-group {
    margin-bottom: 15px;
  }
  
  .token-selector {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .token-selector .token-input {
    width: 100%;
  }
  
  .token-selector .max-btn {
    position: relative;
    margin-top: 5px;
    margin-left: 0;
  }
  
  /* 流动性挖矿优化 */
  .liquidity-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .liquidity-actions {
    flex-direction: column;
  }
  
  .liquidity-actions .card {
    width: 100%;
    margin-bottom: 20px;
  }
  
  /* 表格优化 */
  .transactions-table {
    display: block;
    overflow-x: auto;
  }
  
  /* 管理员面板优化 */
  .admin-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    margin-bottom: 20px;
  }
  
  .stats-row, .chart-row {
    flex-direction: column;
  }
  
  .stat-card, .chart-card {
    width: 100%;
    margin-bottom: 15px;
  }
  
  .risk-controls .control-group {
    margin-bottom: 20px;
  }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  .modal-content {
    width: 95%;
  }
  
  .filters > div {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
  }
  
  .filters input, .filters select {
    width: 100%;
    margin-top: 5px;
  }
  
  .pagination {
    flex-wrap: wrap;
  }
  
  .pagination button {
    margin: 3px;
  }
}

/* 移动设备上的方向优化 */
@media (max-width: 768px) and (orientation: landscape) {
  .container {
    padding: 5px;
  }
  
  .swap-container, .liquidity-container {
    max-height: 80vh;
    overflow-y: auto;
  }
}

/* 黑暗模式支持 */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }
  
  .card, .stat-card {
    background-color: #1e1e1e;
    border-color: #333;
  }
  
  input, select, button {
    background-color: #2d2d2d;
    color: #fff;
    border-color: #444;
  }
  
  table {
    background-color: #1e1e1e;
  }
  
  th, td {
    border-color: #333;
  }
}